home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / New System Software Extensions / Apple Guide Authoring Kit / Engineering / Interfaces / InterfacesETO / AppleGuide.a next >
Encoding:
Text File  |  1994-07-18  |  7.3 KB  |  345 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleGuide.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a1+  unofficial build.  Sunday, July 17, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__APPLEGUIDE__') = 'UNDEFINED' THEN
  18. __APPLEGUIDE__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  22.     include 'AppleEvents.a'
  23.     ENDIF
  24. ;        include 'Errors.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'Types.a'                                            ;
  27. ;        include 'Memory.a'                                            ;
  28. ;            include 'MixedMode.a'                                    ;
  29. ;        include 'OSUtils.a'                                        ;
  30. ;        include 'Events.a'                                            ;
  31. ;            include 'Quickdraw.a'                                    ;
  32. ;                include 'QuickdrawText.a'                            ;
  33. ;        include 'EPPC.a'                                            ;
  34. ;            include 'PPCToolbox.a'                                    ;
  35. ;                include 'AppleTalk.a'                                ;
  36. ;            include 'Processes.a'                                    ;
  37. ;                include 'Files.a'                                    ;
  38. ;        include 'Notification.a'                                    ;
  39.  
  40. AGAppInfo                 RECORD    0
  41. eventId                     ds.l    1
  42. refCon                     ds.l    1
  43. contextObj                 ds.l    1                                    ; private system field
  44. sizeof                     EQU    *
  45.                         ENDR
  46.  
  47.  
  48. gestaltAppleGuidePresent        EQU        31
  49. gestaltAppleGuideIsDebug        EQU        30
  50. kAGDefault                        EQU        0
  51. kAGFrontDatabase                EQU        1
  52. kAGNoMixin                        EQU        (-1)
  53.  
  54. kAGViewFullHowdy                EQU        1                    ; Full-size Howdy
  55. kAGViewTopicAreas                EQU        2                    ; Full-size Topic Areas
  56. kAGViewIndex                    EQU        3                    ; Full-size Index Terms
  57. kAGViewLookFor                    EQU        4                    ; Full-size Look-For (Search)
  58. kAGViewSingleHowdy                EQU        5                    ; Single-list-size Howdy
  59. kAGViewSingleTopics                EQU        6                    ; Single-list-size Topics
  60.  
  61. kAGFileMain                        EQU        'poco'
  62. kAGFileMixin                    EQU        'mixn'
  63.  
  64. ; To test against AGGetAvailableDBTypes
  65. kAGDBTypeBitAny                    EQU        $00000001
  66. kAGDBTypeBitHelp                EQU        $00000002
  67. kAGDBTypeBitTutorial            EQU        $00000004
  68. kAGDBTypeBitShortcuts            EQU        $00000008
  69. kAGDBTypeBitAbout                EQU        $00000010
  70. kAGDBTypeBitOther                EQU        $00000080
  71.  
  72. ; Returned by AGGetStatus
  73. kAGIsNotRunning                    EQU        0
  74. kAGIsSleeping                    EQU        1
  75. kAGIsActive                        EQU        2
  76.  
  77. ; Returned by AGGetFrontWindowKind
  78. kAGNoWindow                        EQU        0
  79. kAGAccessWindow                    EQU        1
  80. kAGPresentationWindow            EQU        2
  81.  
  82. ; Error Codes
  83. ; Not an enum, because other OSErrs are valid.
  84. ; Apple Guide error codes
  85. ; -------------------- Apple event reply codes
  86. kAGErrUnknownEvent                EQU        -2900
  87. kAGErrCantStartup                EQU        -2901
  88. kAGErrNoAccWin                    EQU        -2902
  89. kAGErrNoPreWin                    EQU        -2903
  90. kAGErrNoSequence                EQU        -2904
  91. kAGErrNotOopsSequence            EQU        -2905
  92. kAGErrReserved06                EQU        -2906
  93. kAGErrNoPanel                    EQU        -2907
  94. kAGErrContentNotFound            EQU        -2908
  95. kAGErrMissingString                EQU        -2909
  96. kAGErrInfoNotAvail                EQU        -2910
  97. kAGErrEventNotAvailable            EQU        -2911
  98. kAGErrCannotMakeCoach            EQU        -2912
  99. kAGErrSessionIDsNotMatch        EQU        -2913
  100. kAGErrMissingDatabaseSpec        EQU        -2914
  101. ; -------------------- Coach's Chalkboard reply codes
  102. kAGErrItemNotFound                EQU        -2925
  103. kAGErrBalloonResourceNotFound    EQU        -2926
  104. kAGErrChalkResourceNotFound        EQU        -2927
  105. kAGErrChdvResourceNotFound        EQU        -2928
  106. kAGErrAlreadyShowing            EQU        -2929
  107. kAGErrBalloonResourceSkip        EQU        -2930
  108. kAGErrItemNotVisible            EQU        -2931
  109. kAGErrReserved32                EQU        -2932
  110. kAGErrNotFrontProcess            EQU        -2933
  111. kAGErrMacroResourceNotFound        EQU        -2934
  112. ; -------------------- API reply codes
  113. kAGErrAppleGuideNotAvailable    EQU        -2951
  114. kAGErrCannotInitCoach            EQU        -2952
  115. kAGErrCannotInitContext            EQU        -2953
  116. kAGErrCannotOpenAliasFile        EQU        -2954
  117. kAGErrNoAliasResource            EQU        -2955
  118. kAGErrDatabaseNotAvailable        EQU        -2956
  119. kAGErrDatabaseNotOpen            EQU        -2957
  120. kAGErrMissingAppInfoHdl            EQU        -2958
  121. kAGErrMissingContextObject        EQU        -2959
  122. kAGErrInvalidRefNum                EQU        -2960
  123. kAGErrDatabaseOpen                EQU        -2961
  124. kAGErrInsufficientMemory        EQU        -2962
  125.  
  126. ; Events
  127. ; Not an enum because we want to make assignments.
  128. ; Handy events for AGGeneral.
  129. ; Panel actions (Require a presentation window).
  130. kAGEventDoCoach                    EQU        'doco'
  131. kAGEventDoHuh                    EQU        'dhuh'
  132. kAGEventGoNext                    EQU        'gonp'
  133. kAGEventGoPrev                    EQU        'gopp'
  134. kAGEventHidePanel                EQU        'pahi'
  135. kAGEventReturnBack                EQU        'gobk'
  136. kAGEventShowPanel                EQU        'pash'
  137. kAGEventTogglePanel                EQU        'patg'
  138.  
  139. ; Functions
  140. ; AGClose
  141. ; Close the database associated with the AGRefNum.
  142.     IF GENERATING68K THEN
  143.         Macro
  144.         _AGClose
  145.             moveq    #17,d0
  146.             dc.w     $AA6E
  147.         EndM
  148.     ELSE
  149.         IMPORT    AGClose
  150.     ENDIF
  151.  
  152. ; AGGeneral
  153. ; Cause various events to happen.
  154.     IF GENERATING68K THEN
  155.         Macro
  156.         _AGGeneral
  157.             moveq    #13,d0
  158.             dc.w     $AA6E
  159.         EndM
  160.     ELSE
  161.         IMPORT    AGGeneral
  162.     ENDIF
  163.  
  164. ; AGGetAvailableDBTypes
  165. ; Return the database types available for this application.
  166.     IF GENERATING68K THEN
  167.         Macro
  168.         _AGGetAvailableDBTypes
  169.             moveq    #8,d0
  170.             dc.w     $AA6E
  171.         EndM
  172.     ELSE
  173.         IMPORT    AGGetAvailableDBTypes
  174.     ENDIF
  175.  
  176. ; AGGetFrontWindowKind
  177. ; Return the kind of the front window.
  178.     IF GENERATING68K THEN
  179.         Macro
  180.         _AGGetFrontWindowKind
  181.             moveq    #12,d0
  182.             dc.w     $AA6E
  183.         EndM
  184.     ELSE
  185.         IMPORT    AGGetFrontWindowKind
  186.     ENDIF
  187.  
  188. ; AGGetFSSpec
  189. ; Return the FSSpec for the AGRefNum.
  190.     IF GENERATING68K THEN
  191.         Macro
  192.         _AGGetFSSpec
  193.             moveq    #15,d0
  194.             dc.w     $AA6E
  195.         EndM
  196.     ELSE
  197.         IMPORT    AGGetFSSpec
  198.     ENDIF
  199.  
  200. ; AGGetStatus
  201. ; Return the status of Apple Guide.
  202.     IF GENERATING68K THEN
  203.         Macro
  204.         _AGGetStatus
  205.             moveq    #9,d0
  206.             dc.w     $AA6E
  207.         EndM
  208.     ELSE
  209.         IMPORT    AGGetStatus
  210.     ENDIF
  211.  
  212. ; AGInstallCoachHandler
  213. ; Install a Coach object location query handler.
  214.     IF GENERATING68K THEN
  215.         Macro
  216.         _AGInstallCoachHandler
  217.             moveq    #18,d0
  218.             dc.w     $AA6E
  219.         EndM
  220.     ELSE
  221.         IMPORT    AGInstallCoachHandler
  222.     ENDIF
  223.  
  224. ; AGInstallContextHandler
  225. ; Install a context check query handler.
  226.     IF GENERATING68K THEN
  227.         Macro
  228.         _AGInstallContextHandler
  229.             moveq    #19,d0
  230.             dc.w     $AA6E
  231.         EndM
  232.     ELSE
  233.         IMPORT    AGInstallContextHandler
  234.     ENDIF
  235.  
  236. ; AGIsDatabaseOpen
  237. ; Return true if the database associated with the AGRefNum is open.
  238.     IF GENERATING68K THEN
  239.         Macro
  240.         _AGIsDatabaseOpen
  241.             moveq    #6,d0
  242.             dc.w     $AA6E
  243.         EndM
  244.     ELSE
  245.         IMPORT    AGIsDatabaseOpen
  246.     ENDIF
  247.  
  248. ; AGOpen
  249. ; Open a guide database.
  250.     IF GENERATING68K THEN
  251.         Macro
  252.         _AGOpen
  253.             moveq    #1,d0
  254.             dc.w     $AA6E
  255.         EndM
  256.     ELSE
  257.         IMPORT    AGOpen
  258.     ENDIF
  259.  
  260. ; AGOpenWithSearch
  261. ; Open a guide database and preset a search string.
  262.     IF GENERATING68K THEN
  263.         Macro
  264.         _AGOpenWithSearch
  265.             moveq    #2,d0
  266.             dc.w     $AA6E
  267.         EndM
  268.     ELSE
  269.         IMPORT    AGOpenWithSearch
  270.     ENDIF
  271.  
  272. ; AGOpenWithSequence
  273. ; Open a guide database and display a presentation window sequence.
  274.     IF GENERATING68K THEN
  275.         Macro
  276.         _AGOpenWithSequence
  277.             moveq    #4,d0
  278.             dc.w     $AA6E
  279.         EndM
  280.     ELSE
  281.         IMPORT    AGOpenWithSequence
  282.     ENDIF
  283.  
  284. ; AGOpenWithView
  285. ; Open a guide database and override the default view.
  286.     IF GENERATING68K THEN
  287.         Macro
  288.         _AGOpenWithView
  289.             moveq    #5,d0
  290.             dc.w     $AA6E
  291.         EndM
  292.     ELSE
  293.         IMPORT    AGOpenWithView
  294.     ENDIF
  295.  
  296. ; AGQuit
  297. ; Make Apple Guide quit.
  298.     IF GENERATING68K THEN
  299.         Macro
  300.         _AGQuit
  301.             moveq    #16,d0
  302.             dc.w     $AA6E
  303.         EndM
  304.     ELSE
  305.         IMPORT    AGQuit
  306.     ENDIF
  307.  
  308. ; AGRemoveCoachHandler
  309. ; Remove the Coach object location query handler.
  310.     IF GENERATING68K THEN
  311.         Macro
  312.         _AGRemoveCoachHandler
  313.             moveq    #20,d0
  314.             dc.w     $AA6E
  315.         EndM
  316.     ELSE
  317.         IMPORT    AGRemoveCoachHandler
  318.     ENDIF
  319.  
  320. ; AGRemoveContextHandler
  321. ; Remove the context check query handler.
  322.     IF GENERATING68K THEN
  323.         Macro
  324.         _AGRemoveContextHandler
  325.             moveq    #21,d0
  326.             dc.w     $AA6E
  327.         EndM
  328.     ELSE
  329.         IMPORT    AGRemoveContextHandler
  330.     ENDIF
  331.  
  332. ; AGStart
  333. ; Start up Apple Guide in the background.
  334.     IF GENERATING68K THEN
  335.         Macro
  336.         _AGStart
  337.             moveq    #10,d0
  338.             dc.w     $AA6E
  339.         EndM
  340.     ELSE
  341.         IMPORT    AGStart
  342.     ENDIF
  343.  
  344.     ENDIF ; __APPLEGUIDE__
  345.